#!/bin/bash

dbname="vis_search_engine"

mysql -uroot -pmysql -h127.0.0.1 --default-character-set=utf8 -e "DROP DATABASE IF EXISTS $dbname"
mysql -uroot -pmysql -h127.0.0.1 --default-character-set=utf8 -e "CREATE DATABASE IF NOT EXISTS $dbname DEFAULT CHARACTER SET utf8"
mysql -uroot -pmysql -h127.0.0.1 --default-character-set=utf8 $dbname -e "source vis_search_engine.sql"
mysql -uroot -pmysql -h127.0.0.1 --default-character-set=utf8 $dbname -e "source data.sql"
mysql -uroot -pmysql -h127.0.0.1 --default-character-set=utf8 $dbname -e "source routines.sql"
